'use strict';
const db = uniCloud.database()
exports.main = async (event, context) => {
	//event为客户端上传的参数
	let {id,nickname,avatar,gender,role,years,birthday,wx_number} = event
	let res = await db.collection('uni-id-users').doc(id).update({
		nickname,
		gender,
		role,
		avatar,
		years,
		birthday,
		wx_number
	})
	//返回数据给客户端
	return {
		code: 200,
		msg: '上传成功',
		data: res.data
	}
};
